import React from 'react';
import ReactDOM from 'react-dom';
import registerServiceWorker from './registerServiceWorker';
import {
  BrowserRouter as Router,
  Switch
} from 'react-router-dom'
import 'antd/dist/antd.css'
import { Provider } from 'mobx-react';
import stores from './store/main'

import './public/css/reset.css'
import { routes , RouteWithSubRoutes } from './router/index'
import 'flexibility'



// For easier debugging
window._____APP_STATE_____ = stores;

class App extends React.Component{
  render (){
      return (
      <Provider {...stores}>
        <Router>
          <Switch>
          {routes.map((route, i) => (
            <RouteWithSubRoutes key={i} {...route}/>
          ))}
          </Switch>
        </Router>
      </Provider>)
  }
}

       
ReactDOM.render( <App/>, document.getElementById('root'));
registerServiceWorker();
